import http, { RequestParams } from '@/utils/request';

class HomeRequest {
  /**
   * 获取呼叫器列表
   * @param params
   * @constructor
   */
  public static GetCallerList(params: RequestParams) {
    return http.get<IGetCallListRes[]>('wx/v1/beeper/listIdName', params);
  }

  /**
   * 获取周边模版数据-免登录
   * @param params
   * @constructor
   */
  public static GetSurroundingTemplateData(params: RequestParams) {
    return http.get<IServerBtnListBtnList[]>('wx/v1/beeper/freeVirtual', params);
  }

  /**
   * 获取呼叫器模版数据
   * @param params
   * @constructor
   */
  public static ServerBtnList(params: RequestParams) {
    return http.get<IServerBtnListRes>('wx/v1/beeper/homePage', params);
  }

  /**
   * 获取楼栋单元层 物业缴费基本信息
   * @param params
   * @constructor
   */
  public static GetPropertyPaymentInfo(params: RequestParams) {
    return http.get<IGetPayInfo>('wx/v1/beeperBtn/getPropertyPaymentInfo', params);
  }

  /**
   * 获得产品商户的活动优惠内容即活动价
   * @param params
   * @constructor
   */
  public static GetActivePreferential(params: RequestParams) {
    return http.get<string | undefined>('wx/v1/beeperBtn/getActivePreferential', params);
  }

  /**
   * 设置健康打卡状态
   * @param params
   * @constructor
   */
  public static SetHealthClockState(params: RequestParams) {
    return http.post<number>('wx/v1/customer/healthClock', params);
  }

  /**
   * 获得默认产品
   * @param params
   * @constructor
   */
  public static GetBtnDefaultGoods(params: RequestParams) {
    return http.get<IGetBtnDefaultGoodsRes>('wx/v1/beeperBtn/getBtnDefaultGoods', params);
  }

  /**
   * 消防报警根据呼叫器ID获取栋单元层
   * @param params
   * @constructor
   */
  public static GetBeeperAddress(params: RequestParams) {
    return http.get<IGetBeeperAddress>('wx/v1/userHarvestAddress/getAddressByUser', params);
  }

  /**
   * 获取消防报警记录
   * @param params
   * @constructor
   */
  public static GetAlarmRecord(params: RequestParams) {
    return http.get<IGetAlarmRecord[]>('wx/v1/alarm/listRecentNotEndByBeeper', params);
  }

  /**
   * 查询当前楼栋下消防报警记录
   * @param params
   * @constructor
   */
  public static GetAddressAlarmRecord(params: RequestParams) {
    return http.get<IGetAlarmRecord[]>('wx/v1/alarm/listRecentNotEndByHouseNumber', params);
  }

  /**
   * 提交消防报警订单
   * @param params
   * @constructor
   */
  public static SubmitAlarmOrder(params: RequestParams) {
    return http.post<null>('wx/v1/alarm/alarmReport', params);
  }

  /**
   * 点赞差评
   * @param params
   * @constructor
   */
  public static ActivityClickActions(params: RequestParams) {
    return http.post<null>('wx/v1/activity/clickActions', params);
  }

  //获取通知详情
  public static GetNotifyDetail(params: RequestParams) {
    return http.get<IGetNotifyDetail>('wx/v1/sysNotify/getNewOne', params);
  }

  /**
   * 传id获取指定通知详情
   * @param params
   * @constructor
   */
  public static GetNotifyDetailId(params: RequestParams) {
    return http.get<IGetNotifyDetail>('wx/v1/sysNotify', params);
  }

  /**
   * 获取通知明细列表
   * @param params
   * @constructor
   */
  public static GetMxList(params: RequestParams) {
    return http.get<IGetMxlist[]>('wx/v1/notifyTaskRecord/getList', params);
  }

  /**
   * 获取通知统计
   * @param params
   * @constructor
   */
  public static GetNotifyStatistics(params: RequestParams) {
    return http.get<IGetNotifyStatistics>('wx/v1/sysNotify/getNotifyCount', params);
  }

  /**
   * 通知一键重拨
   * @param params
   * @constructor
   */
  public static OnekeyReport(params: RequestParams) {
    return http.get<null>('wx/v1/sysNotify/againNotify', params);
  }

  /**
   * 获取通知列表
   * @param params
   * @constructor
   */
  public static GetNotifyList(params: RequestParams) {
    return http.get<INotifyList>('wx/v1/sysNotify/page', params);
  }

  /**
   * 受困上报提交
   * @param params
   * @constructor
   */
  public static TrappedUpload(params: RequestParams) {
    return http.post<null>('wx/v1/alarmTrap', params);
  }

  /**
   * 历史上报情况
   * @param params
   * @constructor
   */
  public static GetHistoryTrapped(params: RequestParams) {
    return http.get<ITrappedList[]>('wx/v1/alarmTrap/listData', params);
  }

  /**
   * 获取当前楼栋下用户
   * @param params
   * @constructor
   */
  public static GetCurrentBuildUser(params: RequestParams) {
    return http.get<IBuildUsers>('wx/v1/customer/pageNoMain', params);
  }

  /**
   * 发送物业通知
   * @param params
   * @constructor
   */
  public static SendInform(params: RequestParams) {
    return http.post<null>('wx/v1/customer/noticeNoMain', params);
  }

  /**
   * 获得商户列表
   * @param params
   * @constructor
   */
  public static ObtainMerchantList(params: RequestParams) {
    return http.get<IObtainMerchantListRes[]>('wx/v1/business/listIdName', params);
  }

  /**
   * 获得商户活动
   * @param params
   * @constructor
   */
  public static ObtainMerchantActivity(params: RequestParams) {
    return http.get<IObtainMerchantActivityRes[]>('wx/v1/active/listData', params);
  }

  /**
   * 获得商户banner图
   * @param params
   * @constructor
   */
  public static ObtainMerchantBanner(params: RequestParams) {
    return http.get<IObtainMerchantBannerRes[]>('wx/v1/banner/listIdName', params);
  }

  /**
   * 获得商户是否有摄像头
   * @param params
   * @constructor
   */
  public static ObtainHasMerchantSurveillanceCameras(params: RequestParams) {
    return http.get<number>('wx/v1/camera/checkoutBusinessCamera', params);
  }

  /**
   * 获得商户商品分类
   * @param params
   * @constructor
   */
  public static ObtainProductCategories(params: RequestParams) {
    return http.get<IObtainProductCategoriesRes[]>('wx/v1/businessClassify/listCheckoutData', params);
  }

  /**
   * 获得商户商品列表
   * @param params
   * @constructor
   */
  public static ObtainProductList(params: RequestParams) {
    return http.get<IObtainProductListRes[] | IProductInformation[]>('wx/v1/beeperBtn/list', params);
  }

  /**
   * 获得产品规格
   * @param params
   * @constructor
   */
  public static ObtainProductSpecifications(params: RequestParams) {
    return http.get<IObtainProductSpecificationsRes>('wx/v1/goodsSpec/getSpecByGoodsId', params);
  }

  /**
   * 获得产品详情
   * @param params
   * @constructor
   */
  public static ObtainProductDetails(params: RequestParams) {
    return http.get<IProductInformation>('wx/v1/goods', params);
  }

  /**
   * 收藏/取消收藏产品
   * @param params
   * @constructor
   */
  public static CollectOrCancelProd(params: RequestParams) {
    return http.post<null>('wx/v1/userCollect/setCollect', params);
  }

  /**
   * 获得收藏产品列表
   * @param params
   * @constructor
   */
  public static ObtainCollectedProductList(params: RequestParams) {
    return http.get<{ list: IProductInformation[] }>('wx/v1/beeperBtn/page', params);
  }

  /**
   * 文件上传oss
   * @param params path: 桶子路径 byteFile: base64 type: 1 图片 2 视频 3 pdf
   * @constructor
   */
  public static UploadFileApi(params: { path: string; byteFile: string; type: number }) {
    return http.post<string>('wx/v1/tools/aliyun/sts/getUploadUrl', params);
  }

  /**
   * 线下通知
   * @param params
   * @constructor
   */
  public static OfflineNotice(params: RequestParams) {
    return http.put<null>('wx/v1/sysNotify/offLineNotify', params);
  }

  /**
   * 获得呼叫器部分信息-用于订单提交界面
   * @param params
   * @constructor
   */
  public static ObtainCallerDevicePartInfo(params: RequestParams) {
    return http.get<IObtainCallerDevicePartInfoRes>('wx/v1/beeper/getPortionInfo', params);
  }

  /**
   * 订单提交界面获得地址信息
   * @param params
   * @constructor
   */
  public static ObtainHarvestAddress(params: RequestParams) {
    return http.get<IListShippingAddressesRes>('wx/v1/userHarvestAddress/getAddress', params);
  }

  /**
   * 订单提交界面获得服务员时间信息
   * @param params
   * @constructor
   */
  public static ObtainServerWaiterRelation(params: RequestParams) {
    return http.get<IObtainServerWaiterRelationRes[] | null>('wx/v1/serverWaiterRelation/listTime', params);
  }

  /**
   * 获得产品额外信息
   * @param params
   * @constructor
   */
  public static ObtainProductExtraInfo(params: RequestParams) {
    return http.get<IObtainProductExtraInfoRes | undefined>('wx/v1/attr/listDataByIds', params);
  }

  /**
   * 小程序二维码图片接口
   * @param params
   * @constructor
   */
  public static WeChatMiniProQRCode(params: RequestParams) {
    return http.get<string>('wx/v1/tools/getWxQRCode', params);
  }

  /**
   * 获得呼叫器余额
   * @param params
   * @returns
   */
  public static ObtainCallerDeviceBalance(params: RequestParams) {
    return http.get<number>('wx/v1/beeper/getBeeperBalance', params);
  }

  /**
   * 获取号源时段
   * @param params
   * @returns
   */
  public static ObtainListDoctorTime(params: RequestParams) {
    return http.get<{ begintime: string; endtime: string; sourceid: string }[]>('wx/v1/doctor/listDoctorTime', params);
  }

  /**
   * 根据身份证获取用户数据
   * @param params
   * @returns
   */
  public static ObtainUserDataByIDCard(params: RequestParams) {
    return http.get<IObtainUserDataByIDCardRes>('wx/v1/patientInfo/getDataByIdCard', params);
  }

  /**
   * 一键出院操作
   * @param params
   * @returns
   */
  public static OneClickDischarge(params: RequestParams) {
    return http.get('wx/v1/beeper/btnEventAction', params);
  }

  /**
   * 获得资讯列表
   * @param params
   * @returns
   */
  public static ObtainNewsList(params: RequestParams) {
    return http.get<IListRes<IObtainNewsListRes>>('wx/v1/library/page', params);
  }

  /**
   * 获得资讯标签列表
   * @param params
   * @returns
   */
  public static ObtainNewsTagList(params: RequestParams) {
    return http.get<{ id: number; name: string }[]>('wx/v1/tagInfo/listIdName', params);
  }

  /**
   * 获得全国市区数据
   * @param params
   * @returns
   */
  public static ObtainNationalUrbanAreaData(params: RequestParams) {
    return http.get<IObtainNationalUrbanAreaDataRes>('wx/v1/area/listSpecialAreaData', params);
  }

  /**
   * 获得资讯详情
   * @param params
   * @returns
   */
  public static ObtainNewsDetail(params: RequestParams) {
    return http.get<IObtainNewsDetailRes>('wx/v1/library', params);
  }

  /**
   * 资讯点赞与不喜欢
   * @param params
   * @constructor
   */
  public static NewsActionsUpdate(params: RequestParams) {
    return http.post('wx/v1/library/clickActions', params);
  }

  /**
   * 物业缴费下单
   * @param params
   * @constructor
   */
  public static PropertyPaymentInfoOrder(params: RequestParams) {
    return http.post<IPullWeChatPaymentRes>('wx/v1/order/propertyPaymentInfoOrder', params);
  }

  /**
   * 健康打卡
   * @param params
   * @constructor
   */
  public static HealthCheckInSubmit(params: RequestParams) {
    return http.post<number>('wx/v1/customer/healthClock', params);
  }

  /**
   * 获取活动列表
   * @param params
   * @constructor
   */
  public static ObtainActivityList(params: RequestParams) {
    return http.get<IListRes<IObtainActivityList>>('wx/v1/activity/page', params);
  }

  /**
   * 活动点赞与不喜欢
   * @param params
   * @constructor
   */
  public static ActivityActionsUpdate(params: RequestParams) {
    return http.post('wx/v1/activity/clickActions', params);
  }

  /**
   * 获取活动按钮列表
   * @param params
   * @constructor
   */
  public static ObtainActivityButtonList(params: RequestParams) {
    return http.get<IObtainActivityButtonListRes[]>('wx/v1/activity/listChildBtn', params);
  }

  /**
   * 通过活动按钮获得产品
   * @param params
   * @constructor
   */
  public static ObtainProductThroughButton(params: RequestParams) {
    return http.get<IGetBtnDefaultGoodsRes>('wx/v1/activity/getGoodsByBtn', params);
  }

  /**
   * 获取设备分类下设备列表
   * @param params
   * @constructor
   */
  public static ObtainDeviceListUnderDeviceCategory(params: RequestParams) {
    return http.get<IObtainDeviceListUnderDeviceCategoryRes[]>('wx/v1/beeperBtn/listSafety', params);
  }

  /**
   * 搜索呼叫器下所有产品
   * @param params
   * @constructor
   */
  public static SearchAllProducts(params: RequestParams) {
    return http.get<IListRes<IProductInformation>>('wx/v1/beeperBtn/pageGoodsByName', params);
  }

  /**
   * 查询呼叫器最近急救订单的急救数据
   * @param params
   * @constructor
   */
  public static ObtainRecentFirstAidOrder(params: RequestParams) {
    return http.get<IObtainRecentFirstAidOrderRes | undefined>('wx/v1/beeperBtn/getRecentFirstAidOrder', params);
  }

  /**
 * 获取火灾信息
 * @param params
 * @constructor
 */
  public static GetFireInformation(params: RequestParams) {
    return http.get<IFireInformation>('wx/v1/alarmTrap/checkoutAlarmAndTrapped', params);
  }

  /**
* 获取受困历史上报记录
* @param params
* @constructor
*/
  public static GetTrapHistoryReport(params: RequestParams) {
    return http.get<IHistoryReport[]>('wx/v1/alarmTrap/listData', params);
  }

  //受困情况-新增受困情况数据
  public static SendReportAlarmTrap(params: RequestParams) {
    return http.post<null>('wx/v1/alarmTrap', params);
  }

  //火情上报-新增火情上报数据
  public static SendFireReport(params: RequestParams) {
    return http.post<null>('wx/v1/alarmFire', params);
  }

  /**
* 获取受困历史上报记录
* @param params
* @constructor
*/
  public static GetFireHistoryReport(params: RequestParams) {
    return http.get<IFireHistoryReport[]>('wx/v1/alarmFire/listData', params);
  }
}

export default HomeRequest;
